const {query} = require('../models/db')
exports.findUserByAccount = account => query('select * from user where account=?', [account]);
exports.findUserById = id => query('select * from user where id=?', [id]);
exports.findUsers = () => query('select account,creator,password,reg_time,role_name from user order by reg_time desc');
exports.findUsersByLimit=(start, end)=> query('select account,creator,password,reg_time,role_name from user order by create_time desc limit ?,?',[start, end])
exports.insertUser =params=>query(`insert into user(creator,account,password,role_id,role_name) values('admin',?,?,?,?)`,params);